<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Initializes a stored procedure or a remote stored procedure</title>
 </head>
 <body class="docs"><div id="layout">
  <div id="layout-content"><div id="function.mssql-init" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">mssql_init</h1>
  <p class="verinfo">(PHP 4 &gt;= 4.0.7, PHP 5, PECL odbtp &gt;= 1.1.1)</p><p class="refpurpose"><span class="refname">mssql_init</span> &mdash; <span class="dc-title">Initializes a stored procedure or a remote stored procedure</span></p>

 </div>
 
 <div id="function.mssql-init-refsynopsisdiv">
  <div class="warning"><strong class="warning">Warning</strong>
   
<p class="para">
 This function was <em class="emphasis">REMOVED</em> in PHP 7.0.0.
</p>
<p class="para">
 Alternatives to this function include:
</p>

   <ul class="simplelist">
    <li class="member">
     Using an <em>EXEC</em> query issued through
     <a href="ref.pdo_sqlsrv.html" class="link">PDO_SQLSRV</a>,
     <a href="ref.pdo_odbc.html" class="link">PDO_ODBC</a>,
     <a href="book.sqlsrv.html" class="link">SQLSRV</a>, or the
     <a href="book.uodbc.html" class="link">unified ODBC driver</a>.
    </li>
   </ul>
  </div>
 </div>

 <div class="refsect1 description" id="refsect1-function.mssql-init-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>mssql_init</strong></span>
    ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$sp_name</code></span>
   [, <span class="methodparam"><span class="type">resource</span> <code class="parameter">$link_identifier</code></span>
  ] ) : <span class="type">resource</span></div>

  <p class="para rdfs-comment">
   Initializes a stored procedure or a remote stored procedure.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.mssql-init-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>

    
     <dt>
<code class="parameter">sp_name</code></dt>

     <dd>

      <p class="para">
       Stored procedure name, like <em>ownew.sp_name</em> or
       <em>otherdb.owner.sp_name</em>. 
      </p>
     </dd>

    
    
     <dt>
<code class="parameter">link_identifier</code></dt>

     <dd>

      <p class="para">
       A MS SQL link identifier, returned by 
       <span class="function"><a href="mssql_connect.html" class="function">mssql_connect()</a></span>.
      </p>
     </dd>

    
   </dl>

  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.mssql-init-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   Returns a resource identifier &quot;statement&quot;, used in subsequent calls to
   <span class="function"><a href="mssql_bind.html" class="function">mssql_bind()</a></span> and <span class="function"><a href="mssql_execute.html" class="function">mssql_execute()</a></span>,
   or <strong><code>FALSE</code></strong> on errors. 
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.mssql-init-examples">
  <h3 class="title">范例</h3>
  <p class="para">
   <div class="example" id="example-1765">
    <p><strong>Example #1 <span class="function"><strong>mssql_init()</strong></span> example</strong></p>
    <div class="example-contents">
<div class="phpcode"><pre><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /></span><span style="color: #FF8000">//&nbsp;Connect&nbsp;to&nbsp;MSSQL&nbsp;and&nbsp;select&nbsp;the&nbsp;database<br /></span><span style="color: #0000BB">$link&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">mssql_connect</span><span style="color: #007700">(</span><span style="color: #DD0000">'KALLESPC\SQLEXPRESS'</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'sa'</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'phpfi'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">mssql_select_db</span><span style="color: #007700">(</span><span style="color: #DD0000">'php'</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$link</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">//&nbsp;Create&nbsp;a&nbsp;new&nbsp;statement<br /></span><span style="color: #0000BB">$stmt&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">mssql_init</span><span style="color: #007700">(</span><span style="color: #DD0000">'StatementTest'</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$link</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">//&nbsp;Bind&nbsp;values&nbsp;here<br /><br />//&nbsp;Once&nbsp;values&nbsp;are&nbsp;binded&nbsp;we&nbsp;execute&nbsp;our&nbsp;statement&nbsp;<br />//&nbsp;using&nbsp;mssql_execute:<br /></span><span style="color: #0000BB">mssql_execute</span><span style="color: #007700">(</span><span style="color: #0000BB">$stmt</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">//&nbsp;And&nbsp;we&nbsp;can&nbsp;free&nbsp;it&nbsp;like&nbsp;so:<br /></span><span style="color: #0000BB">mssql_free_statement</span><span style="color: #007700">(</span><span style="color: #0000BB">$stmt</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</pre></div>
    </div>

   </div>
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.mssql-init-seealso">
  <h3 class="title">参见</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"><span class="function"><a href="mssql_bind.html" class="function" rel="rdfs-seeAlso">mssql_bind()</a> - Adds a parameter to a stored procedure or a remote stored procedure</span></li>
    <li class="member"><span class="function"><a href="mssql_execute.html" class="function" rel="rdfs-seeAlso">mssql_execute()</a> - Executes a stored procedure on a MS SQL server database</span></li>
    <li class="member"><span class="function"><a href="mssql_free_statement.html" class="function" rel="rdfs-seeAlso">mssql_free_statement()</a> - Free statement memory</span></li>
   </ul>
  </p>
 </div>


</div></div></div></body></html>